package com.softeem.musicserver.controller;

import com.softeem.musicserver.dto.R;
import com.softeem.musicserver.entity.User;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 实现用户的CRUD操作：
 * 1. 登录
 * 2. 注册
 * 3. 信息更新
 * 4. 用户列表
 * 5. 根据id删除
 */
@Tag(name="用户功能接口",description = "包含用户登录，注册，信息更新，查询等接口方法")
@RestController
public class UserController {

    @Operation(summary = "用户登录",description = "需要提供账号密码实现用户登录")
    @Parameters({
            @Parameter(name = "username",description = "账号",required = true),
            @Parameter(name = "password",description = "密码",required = true)
    })
    @GetMapping("/user/login")
    public R login(String username, String password){
        //todo
        return null;
    }

    @Operation(summary = "用户注册",description = "至少需要提供账号和密码信息")
    @PostMapping("/user/reg")
    public R reg(@Parameter(description = "用户对象信息" ) User user){
        //todo
        return null;
    }
}
